package com.ls.lserp.modules.produce.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ls.lserp.common.persistence.Page;
import com.ls.lserp.common.service.CrudService;
import com.ls.lserp.modules.produce.dao.ProduceLossDao;
import com.ls.lserp.modules.produce.entity.ProduceLoss;
@Service
@Transactional(readOnly = false)
public class ProduceLossService extends CrudService<ProduceLossDao,ProduceLoss>{

	
	
	@Autowired
    private ProduceLossDao produceLossDao;
	    /**
		 * 查询父项
		 * @param page
		 * @param user
		 * @return
		 */
	    public Page<ProduceLoss> findList(Page<ProduceLoss> page, ProduceLoss produceLoss) {
	        // 生成数据权限过滤条件（dsf为dataScopeFilter的简写，在xml中使用 ${sqlMap.dsf}调用权限SQL）
	        //designOption.getSqlMap().put("dsf", dataScopeFilter(user.getCurrentUser(), "o", "a"));
	        // 设置分页参数
	    	produceLoss.setPage(page);
	        // 执行分页查询
	        page.setList(produceLossDao.findList(produceLoss));
	        return page;
	    }
	    
	    /**
		 * 获取 换片数据
		 * @param page
		 * @param user
		 * @return
		 */
	    public List<ProduceLoss> findList(ProduceLoss produceLoss) {
	        return produceLossDao.findList(produceLoss);
	    }
	  
}
